#!/bin/bash

# draw.sh - script for BASH that draws only one track from one LRN-file (stored base directory).

# USAGE:
# ./base/scripts/draw.sh <track_id> <LRN-file> <resulting_PNG-file>


./base/scripts/extrack.pl $1 < $2 > track

FILESIZE=$(stat -c%s "track")
if (($FILESIZE < 5))
then
	exit;
fi

echo "set terminal png
set output \"$3\"
set xlabel \"x\"
set ylabel \"y\"
set grid
plot \"track\" title \"track\" with lines" | gnuplot
rm ./track
